import Vue from 'vue'; //node_moudules里面的直接导入就行
import App from './App.vue'; // ./从根目录src下面找
import './assets/global.css';
import './assets/reset.css';
import router from './routers'//路由
import store from './store'
import ElementUI from 'element-ui';//导入 element-ui
import 'element-ui/lib/theme-chalk/index.css';
import less from 'less'
//========== 引入less =========
Vue.use(less)

//========== 引入element ui =========
Vue.use(ElementUI);


store.dispatch("loginUser/verify").then((resp)=>{
  if(!resp){
    router.push({name:"Login"});
  }
});

//实例vue
new Vue({
  render: h => h(App),
  // 把router路由对象加入到Vue实例中
   router,
  // 把vuex仓库实例放入到Vue实例中
   store,
}).$mount('#app');//挂载App
